import request from "@/utils/request.js";
import httpRequest from "@/utils/httpRequest.js";

//获取当前用户接口
export function reqUserInfo () {
    return request({
        url:"/api/users/current",
        method:"get"
    })
}

//获取分摊工时列表信息
export function reqAllocationList(params){
    return request({
        url:"/workHourAllocations/pages",
        method:'get',
        params
    })
}

//根据id获取某分摊工时信息
export function reqAllocationById(id){
    return request({
        url:"/workHourAllocations/" + id,
        method:"get"
    })
}

//根据id删除某分摊工时信息
export function reqDelAllocationById(id){
    return request({
        url:"/workHourAllocations/" + id,
        method:"delete"
    })
}

//获取生产订单报工记录列表
export function reqProductReportRecord(){
    return request({
        url:"/workHourAllocations/findProductReportRecord",
        method:"get"
    })
}

//获取已分摊的数据信息
export function reqAllocationRecord(){
    return request({
        url:"/workHourAllocations/findAllocationRecord",
        method:"get"
    })
}

//生成分摊单号
export function reqAllocationNumber(){
    return request({
        url:"/workHourAllocations/numberRule/getSeq",
        method:"get"
    })
}

//批量保存/更新
export function reqSaveWorkHourAllocations(data){
    return request({
        url:"/workHourAllocations/saveAll",
        method:"post",
        data:data
    })
}
export function reqUpdateWorkHourAllocations(data){
    return request({
        url:"/workHourAllocations/updateAll",
        method:"post",
        data:data
    })
}